<?php
namespace app\home\controller;
use think\DB;
class Base extends \think\Controller{
	public function base(){
		$request = request();
    	$curPage = $request->action();
		$this->assign("page",$curPage);
		$navs = DB::name("nav_list")->where("parent_id",'0')->limit(8)->select();
		foreach($navs as $k=>$v){
			$str = explode('/', $v['nav_url']);
			$navs[$k]['action'] = $str[count($str)-1];
		}
		$this->assign("navs",$navs);
		$footer = Db::name("nav_list")->where("parent_id","0")->limit(3)->select();
		foreach($footer as $k=>$v){
			$footer[$k]['son'] = Db::name("nav_list")->where("parent_id",$v['nav_id'])->limit(4)->select();
		}
//		dump($footer);die;
		$this->assign("footer",$footer);
	}
}
